<div class="ZZHT-content">
	<div class="ZZHT-user-head clearfix">
		<b>现金赎回</b>
		<span class="user_bread fr">
        当前位置：<span>首页</span>--<span>赎回</span>
		</span>
	</div>
	<div class="mains bz">
		<form name="depositForm" id="deposit" method="post" class="form-condensed nice-validator n-default" data-name="deposit" novalidate="novalidate">
			<div class="form-group">
				<label class="control-label"><span class="text-label">现金余额：</span><span class="ZZHT-fred">&nbsp;¥&nbsp;</span><span class="cash">0.00</span></label>
			</div>
			<div class="form-group">
				<label class="control-label"><span class="text-label">本次赎回数量：</span>
					<input type="text" name="money1" onkeydown="javascript:ZZHT.isNumberdote(this)" aria-required="true" aria-invalid="true">
				</label>
			</div>

			<div class="form-group">
				<label class="control-label"><span class="text-label">服务费：</span><span class="ZZHT-fred">&nbsp;¥&nbsp;</span><span id="poundage">0.00</span></label>
			</div>
			<div class="form-group">
				<label class="control-label"><span class="text-label">预计到账数量：</span><span id="has">0</span></label>
			</div>
			<div class="form-group">
				<label class="control-label"><span class="text-label">银行卡号：</span>
								<select id="J_score">
									<option v-for="v in banklist" :value="v.bankCardId">({{v.bankName}}){{v.accNo.substr(v.accNo.length-4,v.accNo.length)}}</option>
								</select>
								</label>
			</div>
			<div class="form-group">
				<label class="control-label"><span class="text-label">交易密码：</span>
									<input type="text" onfocus="this.type='password'" maxlength="6" fruit="true" autocomplete="off" name="password" data-target="#passwordTips" aria-required="true">
								</label>
				<a class="ZZHT-f999" href="../Usercenter/7-1.html" style="font-size: 12px;">忘记密码？</a>
				<span id="passwordTips"></span>
			</div>
			<!--<button class="sure_btn confirm_pay">确认</button>-->
		</form>
	</div>
</div>

<script type="text/javascript">
	var vm = new Vue({
		el:'#J_score',
		data:{
			banklist:[],
		}
	});
	$.ajax({//获取记录列表
		type: "get",
		url: SURL + "usersBankcards/selectUserBranklist",
		data: {
			"userId":localStorage.userId,
		},
		dataType: 'json',
		success: function(res) {
			if(res.entity.length>0){
				vm.banklist = res.entity;
			}else{
				layer.alert('请先绑定银行卡');
			}
		}
	});
		
	$(function() {
		$.ajax({//获取用户信息 余额
			type: "get",
			url: SURL + "webAccount/getAccountByUserId",
			data: {
				"userId":localStorage.userId,
			},
			dataType: 'json',
			success: function(res) {
				if(res.messageCode==200){
					$('.cash').html(res.entity.cash)
				}else{
					layer.msg(res.message);
				}
			}
		});
		
		$.ajax({//赎回回显
			type: "get",
			url: SURL + "usersDraws/clickRedeem",
			data: {
				"userId":localStorage.userId,
				"type":2
			},
			dataType: 'json',
			success: function(res) {
				console.log(res);
				$("input[name=money1]").change(function() {
					if($(this).val()%100!=0){
						layer.msg('请输入 100的整数倍');
					}else{
						var commonCashDraw = parseFloat(res.entity.taxRatio)+parseFloat(res.entity.commonCashDraws);
						var totalPoundage = $(this).val() * commonCashDraw * 0.01;
						if(totalPoundage) {} else {
							totalPoundage = 0;
						}
						var has = $(this).val() - (totalPoundage.toFixed(2));
						$('#has').text(has);
						$('#poundage').text(totalPoundage.toFixed(2));
						depositForm(commonCashDraw,parseFloat(res.entity.taxRatio),'',$('.cash').html(),'','')
					}
				})
			}
		});
	})
</script>